package com.example.springboot.controller;

import com.example.springboot.document.ResultBo;
import com.example.springboot.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: GoodsController
 * @Author wenlinyu
 * @Date: 2020/12/21 14:44
 * @Version 1.0
 */
@RestController
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @RequestMapping("/goods")
    public ResultBo getList() {
        return new ResultBo(goodsService.getList());
    }

    @GetMapping("/test")
    public ResultBo test() {
        int a = 1 / 0;
        return null;
    }
}
